package com.back.Mapper;

import com.back.Dao.Device;
import com.back.Dao.DeviceData;
import com.back.Dao.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DeviceMapper {

    @Select("select * from device")
    List<Device> findAllDeice();

    // 查询一行
    @Select("select * from device where id = #{id}")
    Device findDeviceById(Integer id);

    // 删除
    @Delete("delete from device where id = #{id}")
    Integer DelDevice(int id);

    //添加
    Integer addDevice(Device device);

    //修改
    Integer updateDevice(Device device);

    //根据地区查询
    @Select("select * from device where address = #{address} ")
    List<Device> findDeviceByAddress(String address);
}